export class ApiError {
  constructor(errors) {
    this.errors = errors || '其它错误';
  }
  codes() {
    return this.errors;
  }
  code() {
    return this.errors;
  }
  msg() {
    return this.errors;
  }
  is(code) {
    return this.code() === code;
  }
}

ApiError.msg = function msg(errors) {
  return new ApiError(errors).msg();
};
